//
//  SportViewController.m
//  B
//
//  Created by lanou on 16/5/5.
//  Copyright © 2016年 裴启航. All rights reserved.
//

#import "SportViewController.h"
#import "SportHealthyViewController.h"      // 运动
#import "SportsShoesViewController.h"   // 运动鞋垫
#import "RunViewController.h"                   // 跑步

@interface SportViewController ()

@end

@implementation SportViewController
- (void)viewWillAppear:(BOOL)animated {
    self.navigationController.navigationBarHidden = YES;
    self.tabBarController.tabBar.hidden = NO;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    NSArray *childVc = [NSArray arrayWithArray:[self createVcs]];
    QHScrollPageView *pageView = [[QHScrollPageView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight) childVcs:childVc parentViewController:self margin:0 index:0];
    [self.view addSubview:pageView];
}
// 创建子控制器数组
- (NSArray *)createVcs {
    SportHealthyViewController *sport = [SportHealthyViewController new];
    sport.title = @"运动";
    SportsShoesViewController *shoes = [SportsShoesViewController new];
    shoes.title = @"运动鞋展";
    RunViewController *run = [RunViewController new];
    run.title = @"全民骑行";
    NSArray *arr = [NSArray arrayWithObjects:sport, shoes, run, nil];
    return arr;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
